import { request } from "../request";

export const notificationApi = {
  // 获取通知列表
  getNotifications: (type = "point", p = 1) => {
    return request(`/api/getNotifications`, "GET", { type, p });
  },

  // 已读所有消息
  readAllNotifications: () => {
    return request("/notifications/all-read", "GET");
  },

  // 批量已读类型的通知
  readNotifications: (type) => {
    return request(`/notifications/make-read/${type}`, "GET");
  },

  // 标记通知为已读
  markAsRead: (notificationId) => {
    return request(`/notification/read/${notificationId}`, "POST");
  },

  // 获取未读通知数量
  getUnreadCount: () => {
    return request("/notifications/unread/count", "GET");
  },
};
